<div class="tableform">
<div class="division">
<form method="post" action="index.php?app=channel&ctl=admin_channel&act=doAddChannel&type=<{$type}>" id="form-group">    
      <table width="100%" cellspacing="0" cellpadding="0" border="0" >
        <tbody>
	        <tr>
		        <th><span style="color:red;font-weight:bold;">*&nbsp;</span>应用类型：</th>
		          <td>
			          <{if $data.channel_type}>
			          <{$data.channel_type}>
			          <{else}>
			          		<select name="channel[channel_type]">
			 					<{foreach from=$channel_type item=value key=key}>
			 						<option value="<{$key}>"><{$value}></option>
								<{/foreach}>
					   	   </select> 
				  </td>
		          	  <{/if}>
		    </tr>
		    <tr>
		        <th><span style="color:red;font-weight:bold;">*&nbsp;</span>应用编号：</th>
		         <td>
		         <{if $data.channel_bn}>
		         	<{$data.channel_bn}>
		         <{else}>
		         	<input type="text" name="channel[channel_bn]" value="" vtype="required"/>
		         <{/if}>
		         
		         </td>
	        </tr>
	        <tr>
	        	<th><span style="color:red;font-weight:bold;">*&nbsp;</span>应用名称：</th>
	            <td><input type="text" name="channel[channel_name]" value="<{$data.channel_name}>" vtype="required"/></td>
	        </tr>
			<tr>
	        	<th>应用描述：</th>
	            <td><textarea name="channel[memo]"  rows="5" cols="50"><{$data.memo}></textarea></td>
	        </tr>
	        <{if $data.channel_id}>
	        	<input  type="hidden" name="channel[channel_id]" value="<{$data.channel_id}>"/>
	        <{/if}>
	        
        </tbody>
      </table>
</form>   
  </div>
</div>
<{area inject=".mainFoot"}>
<div class="table-action">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tbody>
      <tr>
        <td><button class="btn btn-primary" id="submit_btn" ><span><span><{t}>确定<{/t}></span></span></button></td>
      </tr>
    </tbody>
  </table>
</div>
<{/area}>
<script>
(function(){
    var _form = $('form-group');//表单ID 
    var btn   = $('submit_btn');//按钮ID
    
    var finder = finderGroup['<{$env.get.finder_id}>'];
    _form.store('target',{
        onComplete:function(){
        },
        onSuccess:function(response){
            var hash_res_obj = JSON.decode(response);
            if (hash_res_obj.success != undefined && hash_res_obj.success != ""){
                try{
                    var _dialogIns = btn.getParent('.dialog').retrieve('instance');
                }catch(e){}

                if(_dialogIns){
                     finder.refresh();
                    _dialogIns.close();
                }
            }
        }
    });

    btn.addEvent('click',function(){
      _form.fireEvent('submit',{stop:$empty});
    });
})();
</script>












